package sg.com.techstudio.cfoconnect.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import sg.com.techstudio.cfoconnect.dao.RegisterDao;
import sg.com.techstudio.cfoconnect.excel.ReportRegistrationExcel;

@Controller
public class ReportController extends BaseController {
	private static final Log log = LogFactory.getLog(ReportController.class);

	@Autowired
	private ReportRegistrationExcel reportRegistrationExcel;
	
	@Autowired
	private RegisterDao registerDao;
	
	@Override
	protected String getModuleFolder() {
		return "report/";
	}
	
	@RequestMapping(value="reportregistrationexcel"+SPRING_EXT)
	public ModelAndView reportRegistrationExcel(Model model) {
		log.debug("reportRegistrationExcel() entry");
		
		model.addAttribute(PARAM_CONTENT_LIST, registerDao.getAllRegisterObj());
		
		return new ModelAndView(reportRegistrationExcel, "model", model);
	}
}
